<?php if (count($districts) > 0) :?>
<select name="data[district_id]" class="medium_input required">
    <option>--Chọn quận/huyện--</option>
    <?php foreach ($districts as $district) :?>
    <option value="<?php echo $district->id; ?>"><?php echo $district->name; ?></option>
    <?php endforeach; ?>
</select>
<?php endif; ?>